import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


const store = new Vuex.Store({
	state: {
		positionName: "北京市",
		positionRegion: "",
		positionAdcode: "350121", //城市编码
		longitude: 119.216655, //经度
		latitude: 26.040612, //纬度
		userBankCard: null, //用户选择的银行卡
		userAddress: null, //用户选择的地址
		paperRuleShow: true //纸条规则显示

	},
	mutations: {
		setPositionName(state, positionName) {
			state.positionName = positionName;
		},
		setPositionRegion(state, positionRegion) {
			state.positionRegion = positionRegion;
		},
		setPositionAdcode(state, positionAdcode) {
			state.positionAdcode = positionAdcode;
		},
		setLongitude(state, longitude) {
			state.longitude = longitude
		},
		setLatitude(state, latitude) {
			state.latitude = latitude
		},
		setUserBankCard(state, userBankCard) {
			state.userBankCard = userBankCard
		},
		setUserAddress(state, userAddress) {
			state.userAddress = userAddress
		},
		setPaperRuleShow(state, paperRuleShow) {
			state.paperRuleShow = paperRuleShow
		}
	},
	getters: {
		getPositionName(state) {
			return state.positionName
		},
		getPositionRegion(state) {
			return state.positionRegion
		},
		getPositionAdcode(state) {
			return state.getPositionAdcode
		},
		getLongitude(state) {
			return state.longitude
		},
		getLatitude(state) {
			return state.latitude
		},
		getUserBankCard(state) {
			return state.userBankCard
		},
		getUserAddress(state) {
			return state.userAddress
		},
		getPaperRuleShow(state) {
			return state.paperRuleShow
		}
	},
	actions: {

	},

})

export default store
